<?php
include 'checksession.php';
?>
<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="utf-8">
        <title>Server manizales +</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <link rel="stylesheet/less" href="../less/bootstrap.less" type="text/css">
        <link rel="stylesheet/less" href="../less/responsive.less" type="text/css">
        <script src="../js/less-1.3.3.min.js"></script>
        <!--append ‘#!watch’ to the browser URL, then refresh the page. -->

        <link href="../css/bootstrap.min.css" rel="stylesheet">
        <link href="../css/bootstrap-responsive.min.css" rel="stylesheet">
        <link href="../css/style.css" rel="stylesheet">
        <link href="../css/signin.css" rel="stylesheet">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="js/html5shiv.js"></script>
        <![endif]-->

        <!-- Fav and touch icons -->
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../img/apple-touch-icon-144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../img/apple-touch-icon-114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../img/apple-touch-icon-72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="../img/apple-touch-icon-57-precomposed.png">
        <link rel="shortcut icon" href="../img/favicon.png">

        <script type="text/javascript" src="../js/jquery.min.js"></script>
        <script type="text/javascript" src="../js/bootstrap.min.js"></script>
        <script type="text/javascript" src="../js/scripts.js"></script>
        <script type="text/javascript" src="../js/RegistroLogin.js"></script>
        <script type="text/javascript" src="../js/gestion-informacion.js"></script>
        <script type="text/javascript" src="../js/gestion-productos.js"></script>
        <script type="text/javascript" src="../js/jquery.7.1.min.js"></script>
        <script type="text/javascript" src="../js/jquery.form.js"></script>
        <script type="text/javascript" src="../js/scriptImagen.js"></script>

    </head>
    <body onload="verificarInformacion();">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <div class="container-fluid">
                                <a data-target=".navbar-responsive-collapse" data-toggle="collapse" class="btn btn-navbar"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a> <a href="#" class="brand"><?php echo $_SESSION["name"]; ?></a>
                                <div class="nav-collapse collapse navbar-responsive-collapse">
                                    <ul class="nav">
                                        <li id="linformacion" class="active">
                                            <a href="javascript:verificarInformacion();">Información</a>
                                        </li>
                                        <li id="liproductos">
                                            <a href="javascript:listarProductos(<?php echo $_SESSION["id"]; ?>);">Productos</a>
                                        </li>
                                        <li id="liservicios">
                                            <a href="#">Servicios</a>
                                        </li>
                                    </ul>
                                    <ul class="nav pull-right">
                                        <li>
                                            <a href="javascript:cerrar_session();">Salir</a>
                                        </li>
                                    </ul>
                                </div>

                            </div>
                        </div>

                    </div>
                </div>

                <!--Div para llenar la información--> 
                <div id="formulario" class="span12" style="display: none;">
                    <div class="row-fluid">
                        <form class="form-horizontal" action="ajaxupload.php" method="POST" enctype="multipart/form-data">
                            <div class="span6">
                                <div class="control-group">
                                    <label class="control-label" for="inputName">Nombre</label>
                                    <div class="controls">
                                        <input type="text" id="inputNombre" required="true"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputNombreUsuario">Nombre de usuario</label>
                                    <div class="controls">
                                        <input type="text" id="inputNombreUsuario" required="true"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputDescripcion">Descripci&oacute;n de la empresa</label>
                                    <div class="controls">
                                        <textarea id="inputDescripcion" rows="3" cols="20" required="true"></textarea>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputImagen">Imagen</label>
                                    <div class="controls">
                                        <input id="image" value="image"  name="image" type="file" class="form-control" required="" accept="image/*"/>
                                    </div>
                                </div>
                            </div>
                            <div class="span6">
                                <div class="control-group">
                                    <label class="control-label" for="inputDireccion">Direcci&oacute;n</label>
                                    <div class="controls">
                                        <input type="text" id="inputDireccion" required="true"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputTelefono">Tel&eacute;fono</label>
                                    <div class="controls">
                                        <input type="number" id="inputTelefono" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputPagina">P&aacute;gina web</label>
                                    <div class="controls">
                                        <input type="url" id="inputPagina" required="true"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputEmail">Email</label>
                                    <div class="controls">
                                        <input type="email" id="inputEmail" required="true"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputFacebook">Facebook</label>
                                    <div class="controls">
                                        <input type="url" id="inputFacebook" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="inputTwitter">Twitter</label>
                                    <div class="controls">
                                        <input type="url" id="inputTwitter" />
                                    </div>
                                </div>
                            </div>
                            <input type="submit" id="button2" class="btn btn-inverse" style="margin-top:15px"value="Guardar"/>
                            <input type="button" onclick="cancelarEdit()" class="btn btn-primary" style="margin-top:15px"value="Cancelar"/>
                            <input style="display: none" type="text" id="direccion" name="direccion" value="informacion"/>
                        </form>
                    </div> 
                </div>

                <!--Div para mostrar informacion-->
                <div id="informacion" class="span12" style="display: none;">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="row-fluid">
                                <div class="span6">
                                    <img id="imagen" alt="140x140" src="" />
                                </div>
                                <div class="span6">
                                    <h3 id="titulo">
                                        Empresa
                                    </h3>
                                </div>
                            </div>
                            <p id="acerca" style="padding-top: 20px">
                                Acerca de
                            </p>
                        </div>
                        <div class="span6">
                            <table class="table">
                                <tbody>
                                    <tr>
                                        <td>
                                            Direcci&oacute;n
                                        </td>
                                        <td id="direccion">
                                            Calle 52a # 19b - 09
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Tel&eacute;fono
                                        </td>
                                        <td id="telefono">
                                            8854570
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            P&aacute;gina web
                                        </td>
                                        <td id="pagina">

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Email
                                        </td>
                                        <td id="email">

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Facebook
                                        </td>
                                        <td id="facebook">

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Twitter
                                        </td>
                                        <td id="twitter">

                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div> <button onclick="mostrarEditable()" class="btn btn-success" type="button">Editar</button>
                </div>

                <!-- Div productos -->
                <div id="productos" class="span12" style="display: none;">

                    <center>
                        <div id="cargandolistaproductos" class="span12" style="display: none">
                            <img src="../img/cargando.gif" width="25" height="17"/>
                        </div>
                    </center>
                    <br/>
                    <div id="sinproductos" class="hero-unit" style="display: none">
                        <h1>
                            No tienes Productos Todavía Anímate a Registrar algunos!!
                        </h1>
                        <p>

                        </p>
                        <p>
                            <a class="btn btn-primary btn-large" href="#myModalProductos" data-toggle="modal">Nuevo Producto</a>
                        </p>
                    </div>
                </div>

                <!-- Div servicios -->
                <div class="span12">

                </div>

            </div>
            <div class="modal fade" id="myModalProductos" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div style="float:top; background: #eee" class="modal-header">
                    <h3 id="myModalLabel" style="text-align: center">Agregar Producto</h3>
                    <button style="float: right;margin-top: -5%;" type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
                </div>
                <div class="modal-body">
                    <form id="form" action="ajaxupload.php" class="form-signin" method="POST" enctype="multipart/form-data"> 
                        <p><input id="image" value="image"  name="image" type="file" class="form-control" required=""/></p>
                        <input id="nombreProducto" name="nombreProducto" type="text" class="form-control" placeholder="Nombre Producto" required/>
                        <br/>
                        <textarea style="max-width: 220px" id="descripcionProducto" name="descripcionProducto" type="text" class="form-control" placeholder="Descripcion"  required></textarea>
                        <table>
                            <tr>
                                <td>
                                    <input type="submit" id="button" class="btn btn-inverse" style="margin-top:15px"value="Guardar"/>
                                </td>
                                <td>
                                    <div id="cargandoAgregarProducto" style="display:none ;margin-left: 20px;width: 35px;height: 35px;margin-top: 15px;">
                                        <img src="../img/cargando.gif" width="25" height="17" style="margin-top:8px"/></div> 
                                </td>
                                <td style="width: 400px; height: auto;display: none; margin-top: 5px;" >
                                    <label id="resultado"> Resultado </label>
                                </td>
                            </tr>
                        </table>  
                        <input style="display: none" type="text" id="direccion" name="direccion" value="productos"/>    
                    </form>
                </div>
            </div> 
        </div> 
    </body>
</html>
